import React from 'react'
import store, { ADD, MINUS } from '../../redux/store'
export default function index() {
  const addfn = () => {
    store.dispatch({ type: ADD, payload: 2 });
    console.log(store.getState());
  }
  const minusFn = () => {
    store.dispatch({ type: MINUS, payload: 1 })
  }

  return (
    <div style={{ marginLeft: 20 }}>
      <h1>redux测试</h1>
      <h2>{store.getState().count}</h2>
      <button onClick={addfn}>点击我加</button>
      <button onClick={minusFn}>点击我减</button>

    </div>
  )
}
